import createAxios from '/@/utils/axios'

// 合并订单
export const controllerUrl = '/system/customer.Order/'

/**
 * 获取订单详情
 */
export function detailApi(params: anyObj) {
    return createAxios({
        url: controllerUrl + 'detail',
        method: 'post',
        params
    },{
        showSuccessMessage: false,
    })
}

/**
 * 处理批量订单文件
 */
export function batchOrderFileApi(params: anyObj) {
    return createAxios({
        url: controllerUrl + 'batchOrderFile',
        method: 'post',
        params
    },{
        showSuccessMessage: false,
    })
}


/**
 * 修复支付金额
 */
export function updatePayAmountApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updatePayAmount',
        method: 'post',
        data: data,
    },{
        showSuccessMessage: true,
    })
}

export function changeStatusApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'changeStatus',
        method: 'post',
        data: data,
    },{
        showSuccessMessage: true,
    })
}

export function changeDrawbackStatusApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'changeDrawbackStatus',
        method: 'post',
        data: data,
    },{
        showSuccessMessage: true,
    })
}

export function changeOrderTypeApi(params: anyObj) {
    return createAxios({
        url: controllerUrl + 'changeOrderType',
        method: 'get',
        params
    },{
        showSuccessMessage: true,
    })
}

export function pullApi(params: anyObj) {
    return createAxios({
        url: controllerUrl + 'pull',
        method: 'get',
        params
    },{
        showSuccessMessage: true,
    })
}

export function getAgentApi(params: anyObj) {
    return createAxios({
        url: controllerUrl + 'getAgent',
        method: 'get',
        params
    },{
        showSuccessMessage: false,
    })
}

export function changeTradeTypeApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'changeTradeType',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

export function updateAmountApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateAmount',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

export function updateCommissionRateApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateCommissionRate',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

export function updateCommissionRatioApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateCommissionRatio',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

export function updateTelApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateTel',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateAddressApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateAddress',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateNoteApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateNote',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateAmountUsdApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateAmountUsd',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateTermApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateTerm',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

export function editNoteApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'editNote',
        method: 'post',
        data: data,
    },{
        showSuccessMessage: true,
    })
}
export function updateCostApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateCost',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

/**
 * 删除代理商
 */
export function delAgentApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'delAgent',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

/**
 * 保存订单图片
 */
export function saveOrderImagesApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'saveOrderImages',
        method: 'post',
        data: data
    },{
        showSuccessMessage: false,
    })
}


/**
 * 添加代理商
 */
export function addAgentApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'addAgent',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
/**
 * 其他费用
 */
export function updateOtherCostApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateOtherCost',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
/**
 * 销售税率
 */
export function updateSaleRateApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateSaleRate',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
/**
 * 营销利润
 */
export function updateMarketProfitApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateMarketProfit',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateDrawbackRateApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateDrawbackRate',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateDrawbackAmountApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateDrawbackAmount',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateTariffApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateTariff',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateAddedApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateAdded',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateLogisticsAmountApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateLogisticsAmount',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}
export function updateProfitApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateProfit',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}

export function updateFieldApi(data: anyObj) {
    return createAxios({
        url: controllerUrl + 'updateField',
        method: 'post',
        data: data
    },{
        showSuccessMessage: true,
    })
}